package org.pettyfox.utils.io.bis;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.pettyfox.utils.io.bis.annotation.IniField;
import org.pettyfox.utils.io.bis.annotation.IniFile;
import org.pettyfox.utils.io.bis.bean.BaseBeanIni;

/**
 *     
 *
 * @author pettyfox.top  
 * @version V1.0   
 * @date 2020-05-10
 */

@EqualsAndHashCode(callSuper = true)
@IniFile(fileComments = {
         "--- 项目配置文件 ---"
        ,"--- 配置实时生效，请运维人员了解每个字段含义后配置 ---"
})
@Data
public class DemoBeanIni extends BaseBeanIni {
    private static final String GROUP_BOOT = "boot";
    private static final String GROUP_LOG = "log";
    private DemoBeanIni(){
        init();
    }
    public static final DemoBeanIni INSTANCE = new DemoBeanIni();
    @IniField
    private String backupDir = "/backups";

    @IniField(comments = {"认证id"})
    private String appId;

    @IniField(comments = {"认证key"})
    private String appKey;

    @IniField
    private int backupDays = 180;

    @IniField(comments = {"web端口号"},group = GROUP_BOOT,groupComments={"此组配置，修改后重启生效"})
    private int webPort = 8080;

    @IniField(comments = {"webIP，不填自动获取"},group = GROUP_BOOT)
    private String webIp = "127.0.0.1";

    @IniField(group = GROUP_BOOT)
    private Boolean https = true;

    @IniField(comments = {"是否显示日志"},group = GROUP_LOG,groupComments={"此组配置，修改实时生效"})
    private boolean show = false;

    @IniField(comments = {"日志等级","ERROR、WARN、INFO、DEBUG"},group = GROUP_LOG)
    private String level = "INFO";

    @IniField(comments = {"日志保留天数"},group = GROUP_LOG)
    private int expireDay = 20;

    @Override
    public int getVersion() {
        return 1;
    }
}
